/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package interceptor;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

import java.util.Map;
/**
 *
 * @author administrator
 */
public class userInterceptor extends AbstractInterceptor{
    public String intercept(ActionInvocation invocation) throws Exception {
        Map<String,Object> sessionValues = invocation.getInvocationContext()
                .getSession();
        String uni = (String) sessionValues.get("uni");
        if(uni == null)
            return Action.ERROR;
        return invocation.invoke();
    }

}
